package com.cat.service.impl;

import com.cat.dao.CarDao;
import com.cat.pojo.Carlist;
import com.cat.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Service
public class CarServiceImpl implements CarService {
    @Autowired
    private CarDao carDao;
    public List<Carlist> getAllCar() {
        return carDao.getAllCar();
    }

    public boolean addNewCar(Carlist carlist) {
        return carDao.addNewCar(carlist)>0;
    }

    public Carlist getCarById(int id) {
        return carDao.getCarById(id);
    }

    public boolean updateCar(Carlist carlist) {
        return carDao.updateCar(carlist)>0;
    }

    public boolean deleteByCid(int c_id) {
        return carDao.deleteByCid(c_id)>0;
    }

}
